package com.suzus.aiService.common.utils;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;
@JsonIgnoreProperties(ignoreUnknown = true)
public class JsonResponse {
    @JsonProperty("code")
    private int code;

    @JsonProperty("message")
    private String message;

    @JsonProperty("duration")
    private int duration;

    @JsonProperty("result")
    private Result result;

    @JsonProperty("version") //----------------------------
    private String version;

    // Add getter and setter for the `height` field if necessary
    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public Result getResult() {
        return result;
    }

    public void setResult(Result result) {
        this.result = result;
    }
// getters and setters

    public static class Result {
        @JsonProperty("angle")
        private int angle;

        @JsonProperty("width")
        private int width;

        @JsonProperty("lines")
        private List<Line> lines;

        @JsonProperty("height") //----------------------------
        private int height;

        // Add getter and setter for the `height` field if necessary
        public int getHeight() {
            return height;
        }

        public void setHeight(int height) {
            this.height = height;
        }

        public int getAngle() {
            return angle;
        }

        public void setAngle(int angle) {
            this.angle = angle;
        }

        public int getWidth() {
            return width;
        }

        public void setWidth(int width) {
            this.width = width;
        }

        public List<Line> getLines() {
            return lines;
        }

        public void setLines(List<Line> lines) {
            this.lines = lines;
        }
// getters and setters

        public static class Line {
            @JsonProperty("angle")
            private int angle;

            @JsonProperty("type")
            private String type;

            @JsonProperty("direction")
            private int direction;

            @JsonProperty("handwritten")
            private int handwritten;

            @JsonProperty("score")
            private double score;

            @JsonProperty("position")
            private List<Integer> position;

            @JsonProperty("text")
            private String text;

            public int getAngle() {
                return angle;
            }

            public void setAngle(int angle) {
                this.angle = angle;
            }

            public String getType() {
                return type;
            }

            public void setType(String type) {
                this.type = type;
            }

            public int getDirection() {
                return direction;
            }

            public void setDirection(int direction) {
                this.direction = direction;
            }

            public int getHandwritten() {
                return handwritten;
            }

            public void setHandwritten(int handwritten) {
                this.handwritten = handwritten;
            }

            public double getScore() {
                return score;
            }

            public void setScore(double score) {
                this.score = score;
            }

            public List<Integer> getPosition() {
                return position;
            }

            public void setPosition(List<Integer> position) {
                this.position = position;
            }

            public String getText() {
                return text;
            }

            public void setText(String text) {
                this.text = text;
            }
// getters and setters
        }
    }
}
